package
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
	
	import root.TestRoot;
	
	public class HandleHttp extends TestRoot
	{
		public function HandleHttp()
		{
			super();
			
			var loader:URLLoader = new URLLoader();
			var req:URLRequest = new URLRequest("http://127.0.0.1:8090");
			
			var variables:URLVariables = new URLVariables();
			variables.someText = "test text";
			variables.someNum = "test num";
			
			req.data = variables;
			loader.dataFormat = URLLoaderDataFormat.VARIABLES;
			loader.addEventListener(Event.COMPLETE, onLoadComplete);
			loader.load(req);
		}
		
		public	function	onLoadComplete(evt:Event):void{
			var loader:URLLoader = evt.target as URLLoader;
			trace(loader.data);
			trace(loader.data.someText);
			trace(loader.data.someNum);
		}
	}
}